import GraphQLJSON from 'graphql-type-json'

module.exports = {
  Subscription: {
    somethingChanged: {
      resolve: () => {
        return new Date()
      },
      subscribe: () => pubsub.asyncIterator('test')
    }
  },
  Query: {
    greeting: async (root, data, { config, models: { Link } }) => {
      return config
    },
    appName: async (root, data, { models: { Link } }) => {
      return 'ark'
    }
  },
  PageInfo: {
    hasMore: ({ totalPages, currentPage }) => {
      return totalPages > currentPage
    }
  },
  JSON: GraphQLJSON
}
